/*
 * Copyright (c) 2019.
 * http://www.ulabcare.com
 */

package com.mt.roll.passport.controller;

import com.mt.roll.core.base.BaseController;
import com.mt.roll.core.dto.LoginLogDto;
import com.mt.roll.core.vo.R;
import com.mt.roll.passport.service.LogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author jiff
 * @date 2019-07-20
 * @since 1.0
 */
@RestController
@RequestMapping("log")
@Slf4j
@Validated
@Api(value = "日志接口", hidden = true)
public class LogController extends BaseController {
    @Autowired
    private LogService logService;

    @PostMapping("loginLog")
    @ApiOperation(value = "保存登录日志", notes = "提供给内部调用，后续加上权限控制", hidden = true)
    public R<Long> loginLog(@RequestBody LoginLogDto loginLogDto) {
        return logService.saveLoginLog(loginLogDto);
    }

}
